package com.scsj.supermarket.adapter;


import android.content.Context;
import android.graphics.Color;
import android.support.v7.widget.CardView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.scsj.supermarket.R;

import java.util.List;

/**
 * 店铺关注--店铺标签
 */

public class FollowShopSignAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    private Context mContext;

    public FollowShopSignAdapter(Context mContext, List data) {
        super(R.layout.item_follow_shop_sign, data);
        this.mContext = mContext;
    }

    @Override
    protected void convert(final BaseViewHolder helper, final String item) {
            helper.setText(R.id.name_tv, item);

        CardView cardView = helper.getView(R.id.card_cv);
        if (item.equals("信用认证")){
            cardView.setCardBackgroundColor(Color.parseColor("#32c552"));
        }else  if (item.equals("实力认证")){
            cardView.setCardBackgroundColor(Color.parseColor("#4899FC"));
        }else  if (item.equals("上新")){
            cardView.setCardBackgroundColor(Color.parseColor("#FF9019"));
        }else  if (item.equals("促销")){
            cardView.setCardBackgroundColor(Color.parseColor("#F32E2D"));
        }else  if (item.equals("券")){
            cardView.setCardBackgroundColor(Color.parseColor("#4A9AF9"));
        }else  if (item.equals("专题")){
            cardView.setCardBackgroundColor(Color.parseColor("#B665A7"));
        }
    }
}
